<%@page import="java.util.UUID"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<!-- 防止网络不畅时重复点击提交按钮 -->
<script type="text/javascript">
	window.onload = function(){
		var btn = document.getElementById("submitbtn");
		btn.onclick = function(){
			this.disabled = true; //让按钮不可用
			this.parentNode.submit(); //让父节点提交
		}
	}
</script>

</head>
<body>
	<%
		String uuid = UUID.randomUUID().toString();
		//out.println(uuid);
		session.setAttribute("uuid", uuid);
	%>
	<form action="<%=request.getContextPath()%>/sessionTestServlet.sdo">
		<input type="hidden" name="token" value="<%=uuid%>">
		用户名：<input type="text" name="username">
		<br><br>
		密   码：<input type="text" name="pasword">
		<br><br>
		<input type="text" name="checkCode"><img alt="验证码" src="<%=request.getContextPath()%>/drawCheckCode.sdo">
		<br><br>
		<input id="submitbtn" type="submit" value="提交表单">
	</form>
</body>
</html>